﻿<vw:WindowBaseView
    x:Class="WcfClientGenerator.UI.View.EditConfigurationsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:conv="clr-namespace:WcfClientGenerator.UI.Converters"
    xmlns:ctl="clr-namespace:WcfClientGenerator.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:uc="clr-namespace:WcfClientGenerator.UI.UserControls"
    xmlns:util="clr-namespace:WcfClientGenerator.UI.Util"
    xmlns:vw="clr-namespace:Addins.UI.View;assembly=Addins.UI"
    xmlns:wvw="clr-namespace:WcfClientGenerator.UI.View"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="697"
    Height="476"
    d:DesignHeight="300"
    d:DesignWidth="300"
    Style="{DynamicResource noBorderWindowStyle}"
    Title="Configuration"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <vw:WindowBaseView.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/WcfClientGenerator.UI;component/Resources/common.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <conv:ObjectZIndexConverter x:Key="objectZIndexConverter"/>
            <conv:ObjectVisibilityConverter x:Key="objectVisibilityConverter"/>
            <conv:StringListStringConverter x:Key="stringListStringConverter"/>
            <conv:ViewTypeTextConverter x:Key="viewTypeTextConverter"/>
        </ResourceDictionary>
    </vw:WindowBaseView.Resources>
    <Grid>
        <Border Margin="10" BorderBrush="Transparent" BorderThickness="0">
            <Border.Effect>
                <DropShadowEffect BlurRadius="10" ShadowDepth="5"/>
            </Border.Effect>
            <Grid Style="{DynamicResource rootLayoutStyle}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="208"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border BorderBrush="Black" BorderThickness="0" CornerRadius="5"/>
                <Rectangle
                    x:Name="caption"
                    Grid.ColumnSpan="2"
                    Grid.Row="0"
                    Style="{DynamicResource captionRectangleStyle}"/>
                <TextBlock
                    x:Name="txtTitle"
                    Grid.ColumnSpan="2"
                    Grid.Row="0"
                    Style="{DynamicResource titleStyle}"
                    Text="Configuration"/>
                <ContentControl
                    x:Name="cntMessageBox"
                    Grid.Column="0"
                    Grid.ColumnSpan="2"
                    Grid.Row="1"
                    Grid.RowSpan="2"
                    Panel.ZIndex="{Binding Path=MessageBox, Converter={StaticResource objectZIndexConverter}}"
                    Content="{Binding Path=MessageBox}"
                    Visibility="{Binding Path=MessageBox, Converter={StaticResource objectVisibilityConverter}}"/>
                <ContentControl
                    x:Name="cntProjectSelector"
                    Grid.Column="0"
                    Grid.ColumnSpan="2"
                    Grid.Row="1"
                    Grid.RowSpan="2"
                    Panel.ZIndex="{Binding Path=ProjectSelector, Converter={StaticResource objectZIndexConverter}}"
                    Content="{Binding Path=ProjectSelector}"
                    Visibility="{Binding Path=ProjectSelector, Converter={StaticResource objectVisibilityConverter}}"/>
                <wvw:ConfigurationsView
                    x:Name="configurationsView"
                    Grid.Column="0"
                    Grid.Row="1"
                    Margin="8,0,8,0"
                    BorderThickness="0"/>
                <StackPanel
                    x:Name="pnlEditCommands"
                    Grid.Column="0"
                    Grid.Row="2"
                    HorizontalAlignment="Center"
                    Margin="0,0,0,4"
                    Orientation="Horizontal">
                    <Grid Margin="4">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ctl:ImageButton
                            x:Name="btnAdd"
                            HorizontalAlignment="Center"
                            Margin="0,0,0,2"
                            Command="{Binding Path=AddConfigurationCommand}"
                            DisabledImage="/WcfClientGenerator.UI;component/Images/add_grey.png"
                            HoverImage="/WcfClientGenerator.UI;component/Images/add_white.png"
                            NormalImage="/WcfClientGenerator.UI;component/Images/add_black.png"
                            PressedImage="/WcfClientGenerator.UI;component/Images/add_darkgrey.png"
                            Style="{DynamicResource roundButtonStyle}"
                            ToolTip="Add"/>
                        <TextBlock
                            Grid.Row="1"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Style="{DynamicResource buttonLabelStyle}"
                            Text="Add"/>
                    </Grid>
                    <Grid Margin="4">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ctl:ImageButton
                            x:Name="btnDelete"
                            HorizontalAlignment="Center"
                            Margin="0,0,0,2"
                            Command="{Binding Path=ConfirmDeleteConfigurationCommand}"
                            DisabledImage="/WcfClientGenerator.UI;component/Images/minus_grey.png"
                            HoverImage="/WcfClientGenerator.UI;component/Images/minus_white.png"
                            NormalImage="/WcfClientGenerator.UI;component/Images/minus_black.png"
                            PressedImage="/WcfClientGenerator.UI;component/Images/minus_darkgrey.png"
                            Style="{DynamicResource roundButtonStyle}"
                            ToolTip="Delete"/>
                        <TextBlock
                            Grid.Row="1"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Style="{DynamicResource buttonLabelStyle}"
                            Text="Delete"/>
                    </Grid>
                    <Grid Margin="4">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ctl:ImageButton
                            x:Name="btnCopy"
                            HorizontalAlignment="Center"
                            Margin="0,0,0,2"
                            Command="{Binding Path=CopyConfigurationCommand}"
                            DisabledImage="/WcfClientGenerator.UI;component/Images/copy_grey.png"
                            HoverImage="/WcfClientGenerator.UI;component/Images/copy_white.png"
                            NormalImage="/WcfClientGenerator.UI;component/Images/copy_black.png"
                            PressedImage="/WcfClientGenerator.UI;component/Images/copy_darkgrey.png"
                            Style="{DynamicResource roundButtonStyle}"
                            ToolTip="Copy"/>
                        <TextBlock
                            Grid.Row="1"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Style="{DynamicResource buttonLabelStyle}"
                            Text="Copy"/>
                    </Grid>
                </StackPanel>
                <Grid
                    x:Name="grdClientConfiguration"
                    Grid.Column="1"
                    Grid.Row="1"
                    Margin="4">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Grid
                        Grid.Column="1"
                        Grid.Row="0"
                        HorizontalAlignment="Center"
                        Margin="4"
                        VerticalAlignment="Top">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <ctl:ImageButton
                            x:Name="btnMore"
                            HorizontalAlignment="Center"
                            Command="{Binding Path=ToggleViewCommand}"
                            DisabledImage="/WcfClientGenerator.UI;component/Images/navigate_grey.png"
                            HoverImage="/WcfClientGenerator.UI;component/Images/navigate_white.png"
                            ImageSize="32"
                            NormalImage="/WcfClientGenerator.UI;component/Images/navigate_black.png"
                            PressedImage="/WcfClientGenerator.UI;component/Images/navigate_darkgrey.png"
                            Style="{DynamicResource advancedButtonStyle}"
                            ToolTip="{Binding Path=IsAdvancedView, Converter={StaticResource viewTypeTextConverter}}">
                            <Button.RenderTransform>
                                <RotateTransform />
                            </Button.RenderTransform>
                        </ctl:ImageButton>
                    </Grid>
                    <Grid
                        x:Name="grdAdvancedConfiguration"
                        Grid.Row="0"
                        Style="{DynamicResource advancedGridStyle}">
                        
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="10"/>
                            <ColumnDefinition Width="324"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="0"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Temp Folder"/>
                        <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal">
                            <TextBox
                                x:Name="txtGenerationFolder"
                                Width="294"
                                IsReadOnly="True"
                                Text="{Binding Path=SelectedConfiguration.GenerationFolder}"/>
                            <ctl:ImageButton
                                x:Name="btnSelectGenerationFolder"
                                Margin="2"
                                Command="{Binding Path=SelectGenerationFolderCommand}"
                                DisabledImage="/WcfClientGenerator.UI;component/Images/search_grey.png"
                                HoverImage="/WcfClientGenerator.UI;component/Images/search_white.png"
                                ImageSize="20"
                                NormalImage="/WcfClientGenerator.UI;component/Images/search_black.png"
                                PressedImage="/WcfClientGenerator.UI;component/Images/search_darkgrey.png"
                                Style="{DynamicResource roundButtonStyle}"
                                ToolTip="Select folder"/>
                        </StackPanel>
                        
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="2"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Image"/>
                        <StackPanel Grid.Column="2" Grid.Row="2" Orientation="Horizontal">
                            <TextBox
                                x:Name="txtTileImageFile"
                                Width="294"
                                IsReadOnly="True"
                                Text="{Binding Path=SelectedConfiguration.TileImage}"/>
                            <ctl:ImageButton
                                x:Name="btnSelectTileImageFile"
                                Margin="2"
                                Command="{Binding Path=SelectTileImageCommand}"
                                DisabledImage="/WcfClientGenerator.UI;component/Images/search_grey.png"
                                HoverImage="/WcfClientGenerator.UI;component/Images/search_white.png"
                                ImageSize="20"
                                NormalImage="/WcfClientGenerator.UI;component/Images/search_black.png"
                                PressedImage="/WcfClientGenerator.UI;component/Images/search_darkgrey.png"
                                Style="{DynamicResource roundButtonStyle}"
                                ToolTip="Select image"/>
                        </StackPanel>
                        
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="4"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Background"/>
                        <StackPanel Grid.Column="2" Grid.Row="4" Orientation="Horizontal">
                            <ComboBox x:Name="cboColors" ItemsSource="{Binding Path=TileBrushes}" SelectedIndex="{Binding Path=SelectedConfiguration.TileBackgroundIndex, Mode=TwoWay}">
                                <ComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <Rectangle
                                            Width="18"
                                            Height="18"
                                            Margin="2"
                                            VerticalAlignment="Center"
                                            Fill="{Binding}"/>
                                    </DataTemplate>
                                </ComboBox.ItemTemplate>
                            </ComboBox>
                        </StackPanel>

                        <CheckBox
                            x:Name="chkUseGeneratorService"
                            Grid.Column="0"
                            Grid.Row="6"
                            Margin="4"
                            VerticalAlignment="Center"
                            IsChecked="{Binding Path=SelectedConfiguration.UseGeneratorService}"
                            Content="Use service"/>

                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="8"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Service URL"/>
                        <TextBox
                            x:Name="txtGeneratorServiceURL"
                            Width="324"
                            Grid.Column="2"
                            Grid.Row="8"
                            HorizontalAlignment="Left"
                            IsEnabled="{Binding ElementName=chkUseGeneratorService, Path=IsChecked}"
                            Text="{Binding Path=SelectedConfiguration.GeneratorServiceUrl}"/>

                    </Grid>
                    <Grid x:Name="grdBasicConfiguration" Grid.Row="0" Style="{DynamicResource basicGridStyle}" Margin="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="10"/>
                            <ColumnDefinition Width="324"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="0"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Name"/>
                        <TextBox
                            x:Name="txtName"
                            Grid.Column="2"
                            Grid.Row="0"
                            Margin="0,4,0,0"
                            Text="{Binding Path=SelectedConfiguration.Name, UpdateSourceTrigger=PropertyChanged}"/>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="2"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Contracts"/>
                        <ComboBox
                            x:Name="cmbContracts"
                            Width="324"
                            Grid.Column="2"
                            Grid.Row="2"
                            HorizontalAlignment="Left"
                            Background="White"
                            ItemsSource="{Binding Path=SolutionProjects}"
                            SelectedItem="{Binding Path=SelectedConfiguration.ContractsProjectName}"/>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="4"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Sync Proxies"/>
                        <StackPanel Grid.Column="2" Grid.Row="4" Orientation="Horizontal">
                            <TextBox
                                x:Name="txtSyncProxiesProjects"
                                Width="294"
                                IsReadOnly="True"
                                Text="{Binding Path=SelectedConfiguration.SyncDestinationProjects, Converter={StaticResource stringListStringConverter}}"
                                ToolTip="{Binding Path=SelectedConfiguration.SyncDestinationProjects, Converter={StaticResource stringListStringConverter}}"/>
                            <ctl:ImageButton
                                x:Name="btnSelectSyncProxiesProjects"
                                Margin="2"
                                Command="{Binding Path=SelectSyncProxiesDestinationsCommand}"
                                DisabledImage="/WcfClientGenerator.UI;component/Images/search_grey.png"
                                HoverImage="/WcfClientGenerator.UI;component/Images/search_white.png"
                                ImageSize="20"
                                NormalImage="/WcfClientGenerator.UI;component/Images/search_black.png"
                                PressedImage="/WcfClientGenerator.UI;component/Images/search_darkgrey.png"
                                Style="{DynamicResource roundButtonStyle}"
                                ToolTip="Select project"/>
                        </StackPanel>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="6"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Async Proxies"/>
                        <StackPanel Grid.Column="2" Grid.Row="6" Orientation="Horizontal">
                            <TextBox
                                x:Name="txtAsyncProxiesProjects"
                                Width="294"
                                IsReadOnly="True"
                                Text="{Binding Path=SelectedConfiguration.AsyncDestinationProjects, Converter={StaticResource stringListStringConverter}}"
                                ToolTip="{Binding Path=SelectedConfiguration.AsyncDestinationProjects, Converter={StaticResource stringListStringConverter}}"/>
                            <ctl:ImageButton
                                x:Name="btnSelectAsyncProxiesProjects"
                                Margin="2"
                                Command="{Binding Path=SelectAsyncProxiesProjectsCommand}"
                                DisabledImage="/WcfClientGenerator.UI;component/Images/search_grey.png"
                                HoverImage="/WcfClientGenerator.UI;component/Images/search_white.png"
                                ImageSize="20"
                                NormalImage="/WcfClientGenerator.UI;component/Images/search_black.png"
                                PressedImage="/WcfClientGenerator.UI;component/Images/search_darkgrey.png"
                                Style="{DynamicResource roundButtonStyle}"
                                ToolTip="Select project"/>
                        </StackPanel>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="8"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Templates"/>
                        <StackPanel Grid.Column="2" Grid.Row="8" Orientation="Horizontal">
                            <TextBox
                                x:Name="txtTemplatesAssembly"
                                Width="294"
                                IsReadOnly="True"
                                Text="{Binding Path=SelectedConfiguration.TemplatesAssemblyCodeBase}"
                                ToolTip="{Binding Path=SelectedConfiguration.TemplatesAssemblyCodeBase}"/>
                            <ctl:ImageButton
                                x:Name="btnSelectTemplatesAssembly"
                                Margin="2"
                                Command="{Binding Path=SelectTemplatesAssemblyCommand}"
                                DisabledImage="/WcfClientGenerator.UI;component/Images/search_grey.png"
                                HoverImage="/WcfClientGenerator.UI;component/Images/search_white.png"
                                ImageSize="20"
                                NormalImage="/WcfClientGenerator.UI;component/Images/search_black.png"
                                PressedImage="/WcfClientGenerator.UI;component/Images/search_darkgrey.png"
                                Style="{DynamicResource roundButtonStyle}"
                                ToolTip="Select assembly"/>
                        </StackPanel>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="10"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Client Base"/>
                        <TextBox
                            x:Name="txtClientBase"
                            Width="324"
                            Grid.Column="2"
                            Grid.Row="10"
                            HorizontalAlignment="Left"
                            Text="{Binding Path=SelectedConfiguration.ClientBaseName}"/>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="12"
                            Margin="4"
                            VerticalAlignment="Center"
                            Text="Namespace"/>
                        <TextBox
                            x:Name="txtNamespace"
                            Width="324"
                            Grid.Column="2"
                            Grid.Row="12"
                            HorizontalAlignment="Left"
                            Text="{Binding Path=SelectedConfiguration.ServiceContractsNamespace}"/>
                        <TextBlock
                            Grid.Column="0"
                            Grid.Row="14"
                            Margin="4"
                            VerticalAlignment="Top"
                            Text="Usings"/>
                        <TextBox
                            x:Name="txtSpecificUsings"
                            Height="70"
                            Grid.Column="2"
                            Grid.Row="14"
                            AcceptsReturn="True"
                            Text="{Binding Path=SelectedConfiguration.SpecificUsings}"/>
                    </Grid>
                </Grid>
                <StackPanel
                    x:Name="pnlCommands"
                    Grid.Column="1"
                    Grid.Row="2"
                    HorizontalAlignment="Right"
                    Margin="0,0,4,4"
                    Orientation="Horizontal">
                    <Grid Margin="4">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ctl:ImageButton
                            x:Name="btnOk"
                            HorizontalAlignment="Center"
                            Margin="0,0,0,2"
                            Command="{Binding Path=AcceptChangesCommand}"
                            DisabledImage="/WcfClientGenerator.UI;component/Images/check_grey.png"
                            HoverImage="/WcfClientGenerator.UI;component/Images/check_white.png"
                            NormalImage="/WcfClientGenerator.UI;component/Images/check_black.png"
                            PressedImage="/WcfClientGenerator.UI;component/Images/check_darkgrey.png"
                            Style="{DynamicResource roundButtonStyle}"
                            ToolTip="OK"/>
                        <TextBlock
                            Grid.Row="1"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Style="{DynamicResource buttonLabelStyle}"
                            Text="OK"/>
                    </Grid>
                    <Grid Margin="4">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ctl:ImageButton
                            x:Name="btnCancel"
                            HorizontalAlignment="Center"
                            Margin="0,0,0,2"
                            Command="{Binding Path=IgnoreChangesCommand}"
                            DisabledImage="/WcfClientGenerator.UI;component/Images/cancel_grey.png"
                            HoverImage="/WcfClientGenerator.UI;component/Images/cancel_white.png"
                            NormalImage="/WcfClientGenerator.UI;component/Images/cancel_black.png"
                            PressedImage="/WcfClientGenerator.UI;component/Images/cancel_darkgrey.png"
                            Style="{DynamicResource roundButtonStyle}"
                            ToolTip="Cancel"/>
                        <TextBlock
                            Grid.Row="1"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Style="{DynamicResource buttonLabelStyle}"
                            Text="Cancel"/>
                    </Grid>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</vw:WindowBaseView>